#import "GlowVirtuousController.h"
        
#import "GlowVirtuousModel.h"
#import "GlowVirtuousCell.h"
#import "Masonry.h"

@interface GlowVirtuousController () <UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic, strong) UICollectionView *yarnCollectionView;
@property (nonatomic, strong) NSMutableArray *yearlingGrumpyVoyageArray;

@end

@implementation GlowVirtuousController

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self balanceQuenchDreamConfigsview];
	[self yonderfetchData];
}


- (UICollectionView *)yarnCollectionView {
    if (!_yarnCollectionView) {
        UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
        flowLayout.minimumLineSpacing = 10;
        flowLayout.minimumInteritemSpacing = 10;
        flowLayout.itemSize = CGSizeMake(100, 100);
        flowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
        
        _yarnCollectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
        _yarnCollectionView.backgroundColor = UIColor.clearColor;
        _yarnCollectionView.delegate = self;
        _yarnCollectionView.dataSource = self;
        _yarnCollectionView.showsHorizontalScrollIndicator = NO;
        _yarnCollectionView.showsVerticalScrollIndicator = NO;
        [_yarnCollectionView registerClass:[GlowVirtuousCell class] forCellWithReuseIdentifier:NSStringFromClass([GlowVirtuousCell class])];
    }
    return _yarnCollectionView;
}

//: 懒加载数据模型数组
- (NSMutableArray *)yearlingGrumpyVoyageArray {
	if (!_yearlingGrumpyVoyageArray) {
		_yearlingGrumpyVoyageArray = [NSMutableArray array];
	}
	return _yearlingGrumpyVoyageArray;
}

//: 获取数据模型
- (void)yonderfetchData {
	
}

//: 初始化页面UI
- (void)balanceQuenchDreamConfigsview {
	[self.view addSubview:self.yarnCollectionView];
	[self.yarnCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
		make.edges.equalTo(self.view);
	}];
}


#pragma mark - UICollectionView DataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    return self.yearlingGrumpyVoyageArray.count;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    GlowVirtuousCell *yonder = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([GlowVirtuousCell class]) forIndexPath:indexPath];
    return yonder;
}

#pragma mark - UICollectionView Delegate
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
    //: collectioncell 点击
}


@end
